UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'R6VwWmWNT9qQtW9PXgA2QAkehemwcAj9fafMc+6ydJ0=' 
WHERE 
  key_id = '26d452fcb61cdec74cb1529c2ecd7e16ce342addb1b508d289c333552e19832a' 
  AND (
    token = 'R6VwWmWNT9qQtW9PXgA2QAkehemwcAj9fafMc+6ydJ0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015