UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pzAWfS+2bryL5nbAoKtuTi1982xxWObqEEe5g48qOno=' 
WHERE 
  key_id = '63ccaa60d284b40e9721f57d20510d7894c6387c3d0ad4aaaf348777c12b6280' 
  AND (
    token = 'pzAWfS+2bryL5nbAoKtuTi1982xxWObqEEe5g48qOno=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027