UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q/JVEdCYVaCvfMD8Dr5c1Fw6bQ2VqRbCbhU1Mc7BPRw=' 
WHERE 
  key_id = '840af9ebd21e9d1ca438292d13ebfee5ab75243a1edda37912685be118ca4a67' 
  AND (
    token = 'Q/JVEdCYVaCvfMD8Dr5c1Fw6bQ2VqRbCbhU1Mc7BPRw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020