UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'n9QJLVqcrWx2J7a/LhbB8V7lRLfNVBF/Lc4gFRj/Hrg=' 
WHERE 
  key_id = '37186afc61caf8310cc4d05921aa87cce7c4fdc7078ea24d74a22d76178ab099' 
  AND (
    token = 'n9QJLVqcrWx2J7a/LhbB8V7lRLfNVBF/Lc4gFRj/Hrg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024