UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fJDfReq7c3I69PKJym15u+g3MYXrdDI5CTULoXb5cZg=' 
WHERE 
  key_id = '264324df96df88437a5e4781e8b552e3caa7e694f8e5de18e15d4d6d9a3c6eca' 
  AND (
    token = 'fJDfReq7c3I69PKJym15u+g3MYXrdDI5CTULoXb5cZg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042