UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z+P01gQCM556xEVkJeKBLrQ/kgtey90u8pNHhFlZBW8=' 
WHERE 
  key_id = '19185389efb20c83bfa46b6db62f3ff35cab28d2f870e8c945f01735ba9697ac' 
  AND (
    token = 'Z+P01gQCM556xEVkJeKBLrQ/kgtey90u8pNHhFlZBW8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026