UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PLOugpM+8f20tQ7/tDIhnnSeRENTE8lxOP1YBeMjODw=' 
WHERE 
  key_id = '775714aee296862b6e9c67ce45a6bc6ca8ec52bab9774da98308b06ce4b9653d' 
  AND (
    token = 'PLOugpM+8f20tQ7/tDIhnnSeRENTE8lxOP1YBeMjODw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043