UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D9Ik9TB+yllDChErJ2VlDXWtmmYpoEhKt6DfqNB9FnQ=' 
WHERE 
  key_id = '4cfbb243014f66f1402a402c9148edc2c3fb65e8df268be204c49d994d7babc2' 
  AND (
    token = 'D9Ik9TB+yllDChErJ2VlDXWtmmYpoEhKt6DfqNB9FnQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037