UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EJL8BN1TQFw6KdeiTJL6cWP5bfrJF71T9vF7ip2H5as=' 
WHERE 
  key_id = '289b90fd1281c72748ee63ace0409d8f3fdfd631d10a25c2d5281bdf0b5bc0bb' 
  AND (
    token = 'EJL8BN1TQFw6KdeiTJL6cWP5bfrJF71T9vF7ip2H5as=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00066