UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w6W8RU4ejtj4mDk1A6SEuejT2tT8GGCwwp0ViEsYZyw=' 
WHERE 
  key_id = '93ff63699234b89c67bb481551e3852a1ba630ad481216df5237898368e92b28' 
  AND (
    token = 'w6W8RU4ejtj4mDk1A6SEuejT2tT8GGCwwp0ViEsYZyw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031