UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JM/XniP8VwaW1UjcoLJS0T/XzjU7ZDtWbZWEBpBdcS4=' 
WHERE 
  key_id = '3e90e503af8ba75ed7531a602b1a7a47086e82f120f0e7f296c6c74a4f9924b6' 
  AND (
    token = 'JM/XniP8VwaW1UjcoLJS0T/XzjU7ZDtWbZWEBpBdcS4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034