UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RsjQ2ZF4RWB1sB/LwIwekYuVE9h6mABjmyV1adXoSWI=' 
WHERE 
  key_id = '3fd9f91c27c5aba47d6c17e97744183dffdf25845659958c6d705ed27859f7e1' 
  AND (
    token = 'RsjQ2ZF4RWB1sB/LwIwekYuVE9h6mABjmyV1adXoSWI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034