UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6b5LaaRkIThyfL6kyIjORKH6cvMW8Hp37U4Dm1PkMXc=' 
WHERE 
  key_id = '62f3ba9bb460c4f32759de9c776e4afdf58857023247d52410130678c0d5dbf2' 
  AND (
    token = '6b5LaaRkIThyfL6kyIjORKH6cvMW8Hp37U4Dm1PkMXc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030