UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y2Qazp0cxcLoJ7opD3s+FWkNKwGrhEAtUtZWebVXQ70=' 
WHERE 
  key_id = '0dd091df81cefd0afc40c993a5b5cb12c33571a01a1c9cc138e1738dfd6c3e41' 
  AND (
    token = 'y2Qazp0cxcLoJ7opD3s+FWkNKwGrhEAtUtZWebVXQ70=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043