UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BssFcRGtnMt4XZ2s+oSf6bY913VB3dho1LjUw6vCuIE=' 
WHERE 
  key_id = '1cdd9b79372f1fd7c2b0773cc7039ca153add99b9a6d74369376a39bf702c254' 
  AND (
    token = 'BssFcRGtnMt4XZ2s+oSf6bY913VB3dho1LjUw6vCuIE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026